package com.example.springboot_test.easyexcel.model.builder;

import com.example.springboot_test.easyexcel.model.PictureModel;
import lombok.Getter;

/**
 * 图片信息Builder
 *
 * @author xudongmaster
 */
@Getter
public class PictureModelBuilder extends SheetRangeModelBuilder {

    /**
     * 图片数据
     */
    private final byte[] pictureBytes;
    /**
     * 图片类型
     */
    private Integer pictureType;

    protected PictureModelBuilder(String sheetName, int startRowIndex, int endRowIndex, int startColumnIndex, int endColumnIndex
            , byte[] pictureBytes) {
        super(sheetName, startRowIndex, endRowIndex, startColumnIndex, endColumnIndex);
        this.pictureBytes = pictureBytes;
    }

    public static PictureModelBuilder builder(String sheetName, int startRowIndex, int endRowIndex, int startColumnIndex, int endColumnIndex
            , byte[] pictureBytes) {
        return new PictureModelBuilder(sheetName, startRowIndex, endRowIndex, startColumnIndex, endColumnIndex, pictureBytes);
    }

    public PictureModelBuilder pictureType(Integer pictureType) {
        this.pictureType = pictureType;
        return this;
    }

    @Override
    public PictureModel build() {
        return new PictureModel(this);
    }

}
